﻿<UserControl x:Class="Dsl.Ped.Editor.Modules.ErrorArea.ErrorAreaView"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Margin="30,30,30,30">
    <UserControl.Resources>
        <Color x:Key="ErrorColor" A="#FF" R="#C5" G="#D3" B="#F1"/>
    </UserControl.Resources>
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="Auto" MinWidth="400"/>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto" MinHeight="100"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        
        <Border Grid.Column="1" Grid.Row="1">
            <Border.Background>
                <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                    <GradientStop Color="{StaticResource ErrorColor}" Offset="0" />
                    <GradientStop Color="#FFFFFFFF" Offset="1" />
                </LinearGradientBrush>
            </Border.Background>

            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="*"/>
                    <RowDefinition Height="Auto"/>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>
                
                <Image Source="pack://application:,,,/DSLPedFramework;component/Resources/Images/Warning.png"
                       Margin="5,5,5,5"/>
                <Label Grid.Row="0" Grid.Column="1" Content="Unable to load file" VerticalAlignment="Center"/>
                <TextBox Grid.Row="1" Grid.Column="0" 
                         Grid.ColumnSpan="2"  
                         Text="{Binding Path=Error}" 
                         Margin="5" 
                         TextWrapping="Wrap" 
                         IsReadOnly="True"
                         Background="Transparent"/>
                <TextBlock Grid.Row="2"
                           Margin="5,5,5,5">
                    <Hyperlink Command="{Binding Path=ReloadFile}">
                        Reload File
                    </Hyperlink>
                </TextBlock>
            </Grid>
        </Border>
    </Grid>
</UserControl>
